#pragma once
#include <memory>

class IState;
typedef std::shared_ptr<IState> StrongStatePtr;

class IState
{
public:
	virtual void VEnter(const StrongStatePtr& lastState) = 0;
	virtual void VExit(const StrongStatePtr& nextState) = 0;
	virtual void VExecute() = 0;
};

class BaseState : public IState
{
public:
	explicit BaseState() { }
	virtual ~BaseState() { }

};

class StateMachine
{
	StrongStatePtr m_currentState;

public:
	StateMachine();
	~StateMachine() {}

	const StrongStatePtr& GetState();
	void ChangeState(StrongStatePtr newState);
	void ExecuteState();
};